package net.helix.element;

import net.helix.core.transform.Transform;
import net.helix.core.transform.TransformDimension;
import net.helix.engine.library.items.LibraryItem;
import net.helix.engine.properties.Properties;
import net.helix.graphics.IRenderable;

/**
 * Elements are the main objects that are placed inside of frames and rendered in the animation. Some
 * elements might exist which are not visible in the animation however like sounds and particle emmiters.
 * @author Runouw
 *
 */
public abstract class Element implements IRenderable {
	protected Transform transform;
	protected Properties properties;
	
	protected LibraryItem item;
	
	public Element(LibraryItem item){
		transform = new Transform();
		this.item = item;
		if(item != null){
			properties = item.getDefaultPreset();
		}
	}
	public void setDimension(TransformDimension dimension){
		transform.setDimension(dimension);
	}
	public Transform getTransform(){
		return transform;
	}
	public void setTransform(Transform transform){
		this.transform = transform;;
	}
	
	
	public void setProperties(Properties properties){
		this.properties = properties;
	}
	public Properties getProperties(){
		return properties;
	}
	
	// NOTE, a special element (like a primitive or camera should override this)
	public String getSymbolName() {
		return item.name;
	}
}
